#ifndef ILAPP_H_
#define ILAPP_H_

/*
Copyright (C) 2011 Salil Bhagurkar

This file is part of illusion

illusion is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

illusion is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with illusion.  If not, see <http://www.gnu.org/licenses/>.
*/

#define ILAPP_SIGN "ILAPP"

#define ILAPP_DEFAULT_LOAD 0x40000000
#define APIMOD_DEFAULT_LOAD 0x3FC00000

#define is_kernel_address(addr) (addr < (void *)APIMOD_DEFAULT_LOAD)

struct ilapp {
	//Signature
	char sign[8];
	//The below 6 fields are filled in statically by the application itself at link time
	//If you are writing an application, you just have to include the file
	//ilapp_base.h to get this into your application.
	void *header, *load, (*entry)(), *data, *bss, *end;
}__attribute__((packed));

#endif /* ILAPP_H_ */
